package com.feishu.rpc.factory;

import com.feishu.base.dto.entity.ExecutionTypeDO;
import com.feishu.base.type.OutJsonTypeEnum;
import com.feishu.json.factory.ConstructionOutJsonFactory;
import com.feishu.service.RpcSettingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.Map;

@Service
public class RpcDataRealizationFactory {
    @Autowired
    RpcSettingService rpcSettingService;
    @Autowired
    ConstructionOutJsonFactory constructionOutJsonFactory;

    public Map<String,Object> getDataRealization(OutJsonTypeEnum outJsonTypeEnum, String rpcCode, String rpcName, Map<String,Object> bomKeyValue)
            throws Exception {
        Map<String,Object> outMap=constructionOutJsonFactory.getOutJsonData(rpcCode,rpcName,outJsonTypeEnum,new HashMap<>(),bomKeyValue);
        return outMap;
    }

    public ExecutionTypeDO getExecutionType(String rpcCode, String rpcName){
        return rpcSettingService.getExecutionType(rpcCode, rpcName);

    }
}
